//商品详情父表格
export const columns = [
  { title: '品名', dataIndex: 'productNameZh', key: 'productNameZh', align: 'center', },
  { title: '通用名', dataIndex: 'commonName', key: 'commonName', align: 'center', scopedSlots: { customRender: 'commonName' } },
  { title: '生产企业名称', dataIndex: 'manufacturerZh', key: 'manufacturerZh', align: 'center', },
  { title: '规格', dataIndex: 'spec', key: 'spec', align: 'center' },
  { title: '型号', dataIndex: 'model', key: 'model', align: 'center' },
  { title: '计量单位', dataIndex: 'measurement', key: 'measurement', align: 'center' },
  { title: '需配送数量', dataIndex: 'num', key: 'num', align: 'center', scopedSlots: { customRender: 'num' } },
  { title: '单价(元)', dataIndex: 'iunitprice', key: 'iunitprice', align: 'center', scopedSlots: { customRender: 'tofixed2' } },
  { title: '配送数量', dataIndex: 'execNum', key: 'execNum', align: 'center', scopedSlots: { customRender: 'execNum' } },
  { title: '总价(元)', dataIndex: 'totalPrice', key: 'totalPrice', align: 'center', scopedSlots: { customRender: 'totalPrice' } },
  { title: '操作', dataIndex: 'action', key: 'operation', width: 180, align: 'center', scopedSlots: { customRender: 'action' } },
]
//商品详情子表格
export const innerTable = {
  innerColumns: [
    { title: '销售单号', dataIndex: 'saleOrderNo', key: 'saleOrderNo', align: 'center' },
    { title: '品名', dataIndex: 'productNameZh', key: 'productNameZh', align: 'center', },
    { title: '通用名', dataIndex: 'commonName', key: 'commonName', align: 'center' },
    // { title: '生产企业名称', dataIndex: 'manufacturerZh', key: 'manufacturerZh', align: 'center', },
    { title: '规格', dataIndex: 'spec', key: 'spec', align: 'center' },
    // { title: '型号', dataIndex: 'model', key: 'model', align: 'center' },
    { title: '计量单位', dataIndex: 'measurement', key: 'measurement', align: 'center' },
    { title: '需配送数量', dataIndex: 'num', key: 'num', align: 'center', scopedSlots: { customRender: 'num' } },
    { title: '单价(元)', dataIndex: 'iunitprice', key: 'iunitprice', align: 'center', scopedSlots: { customRender: 'iunitprice' } },
    { title: '批号', dataIndex: 'batchCode', key: 'batchCode', align: 'center', width: '140px', scopedSlots: { customRender: 'batchCode' } },
    { title: '生产日期', dataIndex: 'productDate', key: 'productDate', align: 'center', width: '140px', scopedSlots: { customRender: 'productDate' } },
    { title: '有效期', dataIndex: 'expiryDate', key: 'expiryDate', align: 'center', width: '140px', scopedSlots: { customRender: 'expiryDate' } },
    { title: '配送数量', dataIndex: 'execNum', key: 'execNum', align: 'center', width: '100px', scopedSlots: { customRender: 'execNum' } },
    { title: '操作', dataIndex: 'action', key: 'operation', width: 150, align: 'center', scopedSlots: { customRender: 'action' } },
  ],
  innerInputName: [
    { name: 'execNum', type: 'number', placeholder: '数量' },
    { name: 'batchCode', type: 'text', placeholder: '批号' },
    { name: 'productDate', type: 'productDate', placeholder: '生产日期' },
    { name: 'expiryDate', type: 'expiryDate', placeholder: '有效期' },
  ],
  innerData: [],
  innerLoading: false,
}

//配送单信息
export const s_FormInfo = [
  //   { label: '销售单号', name: 'saleOrderNo', type: 'input',isDisabled:true, placeholder: '请输入销售单号' },
  // { label: '配送单号', name: 'deliveryOrderNo', type: 'input',  placeholder: '请选择配送单号' },
  { label: '配送单名称', name: 'deliveryOrderName', type: 'input', placeholder: '请选择配送单名称' },
  // { label: '是否关联多个订单', name: 'multipleOrder', type: 'input', placeholder: '是否关联多个订单' },
  // { label: '关联订单', name: 'associatedOrder', type: 'input', placeholder: '关联订单' },
  // { label: '物流关联单号', name: 'logisticsNo', type: 'input', placeholder: '请输入物流关联单号' },
  { label: '送货类型', name: 'deliveryType', type: 'dicselect', dicName: 'deliveryType', placeholder: '请选择送货类型' },



  { label: '寄件地址', name: 'senderAddr', type: 'deliveryAddressSelect', placeholder: '请输入寄件人姓名' },
  {},
  { label: '寄件人姓名', name: 'sender', type: 'input', placeholder: '请输入寄件人姓名' },
  { label: '寄件人联系电话', name: 'senderTel', type: 'input', placeholder: '请输入寄件人联系电话' },
  // { label: '寄件人证件类型', name: 'senderCertificateType', type: 'input', placeholder: '请输入寄件人证件类型' },
  // { label: '寄件人证件号码', name: 'senderCertificateNo', type: 'input', placeholder: '请输入寄件人证件号码' },
  { label: '收件地址', name: 'receiverAddr', type: 'input', placeholder: '请输入收件地址' },
  {},
  { label: '收件人姓名', name: 'receiver', type: 'input', placeholder: '请输入收件人姓名' },
  { label: '收件人联系电话', name: 'receiverTel', type: 'input', placeholder: '请输入收件人联系电话' },
  { label: '物流方', name: 'logistics', type: 'input', placeholder: '请输入物流方' },
  { label: '物流单号', name: 'logisticsNumber', type: 'input', placeholder: '请选择物流单号' },
  { label: ['保存', '重置'], type: 'botton' },
]

export const s_formDatas = {
  sysSeq: 0,
  pid: null,
  saleOrderNo: null,
  deliveryOrderNo: null,
  deliveryOrderName: null,
  multipleOrder: null,
  associatedOrder: null,
  deliveryType: null,
  logisticsNumber: null,
  sender: null,
  senderTel: null,
  senderAddr: null,
  senderCertificateType: null,
  senderCertificateNo: null,
  receiver: null,
  receiverTel: null,
  receiverAddr: null,
  logisticsNo: null,
  logistics: null,
  deliveryState: '待配送'
}
export const s_rules = {
  sender: [{ required: true, message: '寄件人姓名必填', trigger: 'blur' }],
  senderTel: [{ required: true, message: '寄件人联系电话必填', trigger: 'blur' }],
  senderAddr: [{ required: true, message: '寄件地址必填', trigger: 'blur' }],
  receiver: [{ required: true, message: '收件人姓名必填', trigger: 'blur' }],
  receiverTel: [{ required: true, message: '收件人联系电话必填', trigger: 'blur' }],
  receiverAddr: [{ required: true, message: '收件地址必填', trigger: 'blur' }],
}

//查看明细显示配置
export const invoColumns = [
  // { title: '结算单号', dataIndex: 'settlementNo', key: 'settlementNo', align: 'center' },
  { title: '买方单位', dataIndex: 'customerName', key: 'customerName', align: 'center' },
  // { title: '关联销售订单', dataIndex: 'saleOrderNo', key: 'saleOrderNo', align: 'center' },
  // { title: '买方税号', dataIndex: 'customerTaxNo', key: 'customerTaxNo', align: 'center' },
  // { title: '买方地址电话', dataIndex: 'customerAddrTell', key: 'customerAddrTell', align: 'center' },
  // { title: '买方银行账号', dataIndex: 'customerAccountNum', key: 'customerAccountNum', align: 'center' },
  // { title: '开具单位', dataIndex: 'supplierOrgName', key: 'supplierOrgName', align: 'center' },
  // { title: '开具单位税号', dataIndex: 'supplierTaxNo', key: 'supplierTaxNo', align: 'center' },
  // { title: '开具单位地址电话', dataIndex: 'supplierAddrTel', key: 'supplierAddrTel', align: 'center' },
  // { title: '开具单位银行账号', dataIndex: 'supplierAccountNum', key: 'supplierAccountNum', align: 'center' },
  { title: '发票种类', dataIndex: 'invoiceType', key: 'invoiceType', align: 'center' },
  { title: '发票号码', dataIndex: 'invoiceNo', key: 'invoiceNo', align: 'center' },
  { title: '发票代码', dataIndex: 'invoiceCode', key: 'invoiceCode', align: 'center' },
  // { title: '红票标志', dataIndex: 'redFlag', key: 'redFlag', align: 'center' },
  // { title: '无税总价', dataIndex: 'totalIunitprice', key: 'totalIunitprice', align: 'center',scopedSlots: { customRender: 'tofixed2' }  },
  { title: '含税总价', dataIndex: 'totalPrice', key: 'totalPrice', align: 'center', scopedSlots: { customRender: 'tofixed2' } },
  { title: '税率', dataIndex: 'tax', key: 'tax', align: 'center', scopedSlots: { customRender: 'percentage' } },
  // { title: '税额', dataIndex: 'taxes', key: 'taxes', align: 'center' },
  { title: '状态', dataIndex: 'invoiceState', key: 'invoiceState', align: 'center' },
  { title: '操作', dataIndex: 'action', key: 'operation', width: 180, align: 'center', scopedSlots: { customRender: 'action' } },
]
